﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.WebPages;
using wnet.admin.Comm;

namespace wnet.admin
{
    public class ConstDefine
    {

        internal static bool mIsEnvironmentRunning = true;

        internal static List<AlarmView> mAlarmViews = new List<AlarmView>();

        internal static int mPointNum = 100;

        internal static List<List<Point>> AllData = new List<List<Point>>();
        public static int SkipNum { get; internal set; } = 10;
        public static Project Project { get; internal set; } = new Project();

        public static SensorBusiness mSensorBusiness = new SensorBusiness("sensor", 1);

        public static SensorAlarmBusiness mSensorAlarmBusiness = new SensorAlarmBusiness("alarm", 1);

        internal static List<List<Point>> FlawDdetectionData = new List<List<Point>>();

        public static void InitFlawDdetectionData()
        {
            FlawDdetectionData = new List<List<Point>>();
            FlawDdetectionData.Clear();
            for (int i = 0; i < 64; i++)
            {
                FlawDdetectionData.Add(new List<Point>());
            }
        }
    }

    public class Project
    {
        public Project()
        {
            TitleName = "钢轨全包围在线磁记忆探伤系统";
            IcoName = "why.png";
            PngName = "";
            IP = "192.168.3.3";
            Port = 6001;

            mPointNum = 800;

            DiffK = 0.002;

            JobName = "作业名称";
            JobType = "类型";

            FilePointNum = 256000;

            IsAlgorithmType = true;
        }

        public string JobName { get; set; }
        public string JobType { get; set; }

        /// <summary>
        /// 软件标题
        /// </summary>
        public string TitleName { get; set; }
        public int FontSize { get; set; } = 15;

        /// <summary>
        /// ico图片名称
        /// </summary>
        public string IcoName { get; set; }
        /// <summary>
        /// png图片名称
        /// </summary>
        public string PngName { get; set; }
        /// <summary>
        /// ip地址
        /// </summary>
        public string IP { get; set; }
        /// <summary>
        /// IP的端口号
        /// </summary>
        public int Port { get; set; }

        /// <summary>
        /// 电机系数
        /// </summary>
        public double DiffK { get; set; } = 0.002d;

        /// <summary>
        /// 每个通道显示点数量
        /// </summary>
        public int mPointNum { get; set; } = 800;
        public int SkipNum { get; set; } = 2;

        /// <summary>
        /// 板子数量
        /// </summary>
        public int BoardNum { get; set; } = 2;
        /// <summary>
        /// 通道数  ChannelCount
        /// </summary>
        public int SenSorNum { get; set; } = 32;
        /// <summary>
        /// 360°的探头数
        /// </summary>
        public int SenSorNum360 { get; set; } = 4;

        /// <summary>
        /// 包长
        /// </summary>
        public int PackageLength { get; set; } = 106;

        ///// <summary>
        ///// 有符号的
        ///// </summary>
        //public bool IsSigned { get; set; }

        //public int MethodIndex { get; set; }
        //public string MethodName { get; set; }

        public int TotalPointNum { get; set; } = 250;

        /// <summary>
        /// 文件中存入点的个数
        /// </summary>
        public int FilePointNum { get; set; } = 256000;
        /// <summary>
        /// 启用文件分割
        /// </summary>
        public bool IsFilePointNum { get; set; }

        /// <summary>
        /// 启用算法
        /// </summary>
        public bool IsAlgorithmType { get; set; } = true;

        /// <summary>
        /// 门限值  默认为2e4，根据实际情况调整
        /// </summary>
        public double MenXianMax { get; set; } = 300;

        /// <summary>
        /// true平板电脑  false其它电脑
        /// </summary>
        public bool IsIpad { get; set; }

        /// <summary>
        /// 保存指令数据包
        /// </summary>
        public bool IsSaveCmdByte { get; set; }


        /// <summary>
        /// 界面类型
        /// </summary>
        public string ViewProjectEnum { get; set; } = "ProjectTwo";


        //public string MethodNameEnum { get; set; } = "waveweite";

        /// <summary>
        /// 当前项目名称
        /// </summary>
        public string ProjectNameEnum { get; set; } = "WeiTe";

        ///// <summary>
        ///// 有无符号
        ///// </summary>
        //public bool IsUnsigned { get; set; } = true;

        /// <summary>
        /// 分屏幕显示
        /// </summary>
        public bool IsSplitDisplay { get; set; }

        public bool IsWeiteICO { get; set; }

        /// <summary>
        /// 分屏幕显示
        /// </summary>
        public bool IsSplitDisplay6 { get; set; }

        ///// <summary>
        ///// 屏幕1(通道号)：
        ///// </summary>
        //public string Display1 { get; set; } = "";
        ///// <summary>
        ///// 屏幕2(通道号)：
        ///// </summary>
        //public string Display2 { get; set; } = "";

        ///// <summary>
        ///// 角度列表1
        ///// </summary>
        //public string Degrees1 { get; set; } = "";
        ///// <summary>
        ///// 角度列表2
        ///// </summary>
        //public string Degrees2 { get; set; } = "";
    }
}